<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css"/>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css"/>
	</head>
	<body>
	<div class="am-g">
		 {include file='../Common/hy_header.html'}
		 <div class="am-g">
			<br>
			<div class="am-u-md-10 am-u-end">
				<form class="am-form am-form-horizontal hy-js-form">
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">标题</label>
						<div class="am-u-sm-6">
							<input type="text" name="title" value="{$chat.title}" placeholder="">
						</div>
						<div class="am-u-sm-3">
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">副标题</label>
						<div class="am-u-sm-6">
							<input type="text" name="subtitle" value="{$chat.subtitle}" placeholder="">
						</div>
						<div class="am-u-sm-3">
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">外链地址</label>
						<div class="am-u-sm-6">
							<input type="text" name="source_url" value="{$chat.source_url|default:'http://'}" placeholder="">
						</div>
						<div class="am-u-sm-3">
						</div>
					</div>
						<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">背景图案</label>
						<div class="am-u-sm-6">
							<select name="color" onchange="changeColor()" class="color">
								<option {if $chat.color eq color1}selected="selected"{/if} value="color1"  >color1</option>
								<option {if $chat.color eq color2}selected="selected"{/if} value="color2"  >color2</option>
								<option {if $chat.color eq color3}selected="selected"{/if} value="color3"   >color3</option>
								<option {if $chat.color eq color4}selected="selected"{/if} value="color4"   >color4</option>
								<option {if $chat.color eq color5}selected="selected"{/if} value="color5"  >color5</option>
								<option {if $chat.color eq color6}selected="selected"{/if} value="color6"   >color6</option>
								<option {if $chat.color eq color7}selected="selected"{/if} value="color7"  >color7</option>
								<option {if $chat.color eq color8}selected="selected"{/if} value="color8"   >color8</option>
							</select>
						</div>
						<div class="am-u-sm-3">
							<img id="img_color" {if $chat.color}src="/ws/Mobile/Webroot/gf/images/chat/{$chat.color}_content.png" {else} src="/ws/Mobile/Webroot/gf/images/chat/color1_content.png"{/if}  width="50%">
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label"> 上传图片</label>
						<div class="am-u-sm-6">
							<input type="text" name="pic_url" class="am-input-sm" value="{$chat.pic_url}">
							
				            	
						</div>
						<div class="am-u-sm-3">
							 <img id="hy-thumb" style="height: 30px;" {if $chat.pic_url} src="/ws/{$chat.pic_url}" {else} src="{$_C.hy_path}images/logo2.png" {/if}>
			             		<button class="am-btn am-btn-primary am-btn-xs hy-js-uploadimg" >上传</button>
						</div>
						
						
						
						
					</div>
					
					
					<div class="am-form-group">
		
							
							<label for="user-name" class="am-u-sm-3 am-form-label">绑定弹框组</label>
							<div class="am-u-sm-6 am-u-end">
								<select name="group_id">
									<option value="0">暂不绑定</option>
									{foreach from=$group item=item }
									<option {if $item.id eq $chat.group_id  } selected="selected" {/if} value="{$item.id}">{$item.name}</option>
									{/foreach}
								</select>
								
							</div>
							<div class="am-u-sm-3 am-form-label">若绑定弹框组，则外链地址失效</div>
					
			</div>
					<div class="am-form-group">
		
							
							<label for="user-name" class="am-u-sm-3 am-form-label">绑定红包</label>
							<div class="am-u-sm-6 am-u-end">
								<select name="hongbao_id">
									<option value="0">暂不绑定</option>
									{foreach from=$lucky item=item }
									<option {if $item.id eq $chat.hongbao_id  } selected="selected" {/if} value="{$item.id}">{$item.title}</option>
									{/foreach}
								</select>
								
							</div>
							<div class="am-u-sm-3 am-form-label">若绑定红包，则弹幕组与外链失效</div>
					
			</div>
			
			
					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<input type="hidden" name="id" value="{$id}">
							<button type="button" class="am-btn am-btn-primary hy-js-submit">{$_L.SAVE}</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	  {include file='../Common/hy_footer.html'}
	<script type="text/javascript" src="{$_C.hy_path}js/editor/kindeditor.js"></script>
	 <script src="{$_C.hy_path}js/jscolor.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		
		function changeColor()
		{
			var src = $(".color option:selected").val();
			
			$("#img_color").attr("src","/ws/Mobile/Webroot/gf/images/chat/"+src+"_content.png");
			
		}
		
		
	    hy_uploadimg('/ad',{},function(result){
	    	if(typeof(result[0])!='undefined')
	    	{
	        	$('#hy-thumb').attr('src',"/ws"+result[0]);
	        	$('input[name=pic_url]').val(result[0]).focus();
	       }
	    })
	    
	    hy_submit('index.php?g=admin&m=chat&a={$action}',{},function(result){
				showMsg(result.content, result.error);
	    		parent.$('#special').attr('src', parent.$('#special').attr('src'));
				});
	</script>
	</body>
</html>
